(function(angular) {
	'use strict';
	angular.module("fs.waf").factory("discountService", discountService);
	discountService.$inject = [ '$q', 'loggerFactory', 'ajaxServiceFactory' ];
	function discountService($q, loggerFactory, ajaxServiceFactory) {
		var ajaxServices = ajaxServiceFactory.buildAjaxService({
			getDiscountListOptions: {
				url: 'do/apf/dataList/getDiscountListOptions',
				method: 'get'
			},
			getDiscountViewOptions: {
				url: 'do/apf/dataList/getDiscountViewOptions',
				method: 'get'
			},
			getAssetRepaymentViewOptions: {
				url: 'do/apf/dataList/getAssetRepaymentViewOptions',
				method: 'get'
			}
		});	
		
		function getDiscountListOptions() {
			var defer = $q.defer();
			ajaxServices.getDiscountListOptions().then(function(response) {
				defer.resolve(response.data);
			});
			return defer.promise;
		}
		
		function getDiscountViewOptions() {
			var defer = $q.defer();
			ajaxServices.getDiscountViewOptions().then(function(response) {
				defer.resolve(response.data);
			});
			return defer.promise;
		}
		
		return {
			getDiscountListOptions : getDiscountListOptions,
			getDiscountViewOptions : getDiscountViewOptions
		};
	}
})(angular);